package com.seveneight.baijiesteward.adapter;

import android.content.Context;
import android.widget.TextView;

import com.seveneight.baijiesteward.R;
import com.seveneight.baijiesteward.bean.RecordBean;
import com.seveneight.baijiesteward.utils.StringFormat;

/**
 * Created by user1 on 2018/2/13.
 */

public class RecordAdapter extends ListBaseAdapter<RecordBean> {

    public RecordAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_record;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        TextView tv_type=holder.getView(R.id.tv_type);
        TextView tv_amount=holder.getView(R.id.tv_amount);
        TextView tv_date=holder.getView(R.id.tv_date);
        TextView tv_states=holder.getView(R.id.tv_states);
        RecordBean bean=mDataList.get(position);
        tv_type.setText(bean.getType());
        tv_amount.setText(StringFormat.formatNumber(bean.getAmount()));
        tv_date.setText(bean.getDate());
        tv_states.setText(bean.getStates());
    }
}
